{% extends "base.html" %}
{% block mycontent %}
    <div class="container">
        <h4>反馈列表</h4>
        <hr>
    </div>
    <div>
        <table class="table table-striped table-condensed">
            <thead>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>标题</th>
                <th>时间</th>
                {% if session['is_admin'] %}
                    <th>操作</th>
                {% endif %}
            </tr>
            </thead>
            {% for fb in feedbacks %}
                <tr>
                    <th scope="row">{{ loop.index }}</th>
                    <td>{{ fb.name }}</td>
                    <td><a href="/feedback_item/{{ fb.id }}">{{ fb.title }}</a></td>
                    <td>{{ fb.createTime }}</td>
                    {% if session['is_admin'] %}
                        {% if fb.status != 3 %}
                            <td><a href="/delete_item/{{ fb.id }}" class="btn btn-danger">删除</a></td>
                        {% else %}
                            <td><a href="/revive_item/{{ fb.id }}" class="btn btn-success">还原</a></td>
                        {% endif %}
                    {% endif %}
                </tr>
            {% endfor %}
        </table>
    </div>
{% endblock %}